package Sort;

public class InsertSort {
    public static void main(String[] args) {

    }

    public static void insertSort(int[] array) {

        for (int i = 1;i < array.length;i++) {
            int key = array[i];
            int j = i - 1;
            while(j >=0 && array[j] > array[i]) {
                array[j+1] = array[j];
                j--;
            }
            array[j + 1] = key;
        }
    }
}
